package com.example.shopping.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.shopping.pojo.domain.CarBean;
import com.example.shopping.pojo.domain.FavorBean;
import com.example.shopping.pojo.vo.GoodsVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author Dream
 * @version 1.0
 * @date 2020/11/9 11:49
 */
@Mapper
@Component
public interface FavorDao extends BaseMapper<FavorBean>{

    /**
     * 查询收藏夹商品
     * @param userXh
     * @return
     */
    List<GoodsVo> getByXh(String userXh);

    /**
     * 添加到收藏夹
     * @param favorBean
     */
    void addFavor(FavorBean favorBean);

    FavorBean getBy(@Param(value="userXh") String userXh, @Param(value="goodsId") Integer goodsId);
}
